<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/22
  Time: 14:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" import="com.iotek.ssm.pojo.Resume" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>个人简历</title>
    <link href="../css/resume.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../script/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="../script/commonFunction.js"></script>
    <script type="text/javascript" src="../script/resume.js"></script>
    <style type="text/css"></style>
    <script type="text/javascript">
        $(function () {

            <%--console.log("}}}}}}}}}}}}}}}}resume = " + "${resume}");--%>
            <%--var re = "${resume}";--%>
            <%--console.log($.type(re));--%>
//            if (re !== "") {
            <c:if test="${resume != null}">
            $("#resume_position").append("<option value='${resume.position.id}' selected>${resume.position.position}</option>");
            $("#resume_section").val("${resume.position.section.id}");
            <%--$("#resume_education").val("${resume.education.id}");--%>
            $("#resume_politics").val("${resume.politicsStatus.id}");
            $("#resume_sex_td").html("${resume.sex}");
            $("#resume_salary_td").html("${resume.expectedSalary}");
            $("#resume_table tfoot").hide();
            </c:if>
//            }

            $("#resume_table").find("input").each(function () {
                $(this).blur(function () {
                    $("#resume_submit").attr("disabled", false);
                });
            });

            $("#resume_table").find("select").each(function () {
                $(this).change(function () {
                    $("#resume_submit").attr("disabled", false);
                });
            });

        });
    </script>
</head>

<body id="resume_body">

<%--<c:if test="${resume != null}">--%>
<%--<table cellspacing="1" cellpadding="1" border="solid 1px #000" id="resume_table0">--%>
<%--<thead>--%>
<%--<tr>--%>
<%--<th colspan="4"><p>个人简历</p></th>--%>
<%--</tr>--%>
<%--</thead>--%>
<%--<tbody>--%>
<%--<tr>--%>
<%--<td>真实姓名：</td>--%>
<%--<td>${resume.realName}</td>--%>
<%--<td>性别：</td>--%>
<%--<td>${resume.sex}</td>--%>
<%--</tr>--%>
<%--<tr>--%>
<%--<td>年龄：</td>--%>
<%--<td>${resume.age}</td>--%>
<%--<td>学历：</td>--%>
<%--<td>${resume.education.education}</td>--%>
<%--</tr>--%>
<%--<tr>--%>
<%--<td>联系方式：</td>--%>
<%--<td>${user.phone}</td>--%>
<%--<td>e-mail：</td>--%>
<%--<td>${resume.email}</td>--%>
<%--</tr>--%>
<%--<tr>--%>
<%--<td>应聘职位：</td>--%>
<%--<td>${resume.position.section.section}-${resume.position.position}</td>--%>
<%--<td>政治面貌：</td>--%>
<%--<td>${resume.politicsStatus.politics}</td>--%>
<%--</tr>--%>
<%--<tr>--%>
<%--<td>上一份工作：</td>--%>
<%--<td>${resume.lastJop}</td>--%>
<%--<td>工作经验：</td>--%>
<%--<td>${resume.experience}</td>--%>
<%--</tr>--%>
<%--<tr>--%>
<%--<td>期望薪资：</td>--%>
<%--<td>${resume.expectedSalary}</td>--%>
<%--<td>兴趣爱好：</td>--%>
<%--<td>${resume.hobbies}</td>--%>
<%--</tr>--%>
<%--</table>--%>
<%--</c:if>--%>

<%--<c:if test="${resume == null}">--%>
<form onsubmit="return checkResumeForm()" action="../user/saveResume" method="post">
    <table cellspacing="1" cellpadding="1" border="solid 1px #000" id="resume_table">
        <thead>
        <tr>
            <th colspan="4"><p>个人简历</p></th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>真实姓名：</td>
            <td>
                <input type="text" name="realName" value="${resume.realName}" class="resume_input"
                       placeholder="请输入真实姓名！" id="resume_real_name"/>
            </td>
            <td>性别：</td>
            <td id="resume_sex_td">
                <input type="radio" class="resume_sex" name="sex" value="男" id="man"><label for="man">男</label>
                <input type="radio" class="resume_sex" name="sex" value="女" id="woman"><label for="woman">女</label>
            </td>
        </tr>
        <tr>
            <td>年龄：</td>
            <td>
                <input type="text" id="resume_age" name="age" value="${resume.age}" class="resume_input"
                       placeholder="请输入年龄！">
            </td>
            <td>学历：</td>
            <td>
                <select id="resume_education" name="education.id">
                    <option value="">--学历--</option>
                    <c:forEach items="${educations}" var="education">
                        <option value="${education.id}"
                                <c:if test="${resume.education.id == education.id}">selected</c:if>>
                                ${education.education}
                        </option>
                    </c:forEach>
                </select>
            </td>
        </tr>
        <tr>
            <td>联系方式：</td>
            <td>
                <input type="text" name="user.phone" value="${user.phone}" class="resume_input" readonly>
            </td>
            <td>e-mail：</td>
            <td>
                <input type="text" id="resume_email" name="email" value="${resume.email}" class="resume_input"
                       placeholder="请输入e-mail！">
            </td>
        </tr>
        <tr>
            <td>应聘职位：</td>
            <td>
                <select name="section" id="resume_section" onchange="findPositions()">
                    <option value="">--部门--</option>
                    <c:forEach items="${sections}" var="section">
                        <option value="${section.id}"
                                <c:if test="${resume.position.section.id == section.id}">selected</c:if>>
                                ${section.section}
                        </option>
                    </c:forEach>
                </select>

                <select id="resume_position" name="position.id">
                    <option value="">--职位--</option>
                    <c:if test="${resume.position != null}">
                        <option value="${resume.position.id}" selected>${resume.position.position}</option>
                    </c:if>
                </select>
            </td>
            <td>政治面貌：</td>
            <td>
                <select name="politicsStatus.id" id="resume_politics">
                    <option value="">--政治面貌--</option>
                    <c:forEach items="${politics}" var="po">
                        <option value="${po.id}">${po.politics}</option>
                    </c:forEach>
                </select>
            </td>
        </tr>
        <tr>
            <td>上一份工作：</td>
            <td>
                <input type="text" name="lastJop" id="resume_last_jop" value="${resume.lastJop}"
                       class="resume_input"
                       placeholder="请输入您的上一份工作！">
            </td>
            <td>工作经验：</td>
            <td>
                <input type="text" id="resume_experience" name="experience" value="${resume.experience}"
                       class="resume_input" placeholder="请输入您的工作经验！">
            </td>
        </tr>
        <tr>
            <td>期望薪资：</td>
            <td id="resume_salary_td">
                <select id="resume_salary" name="expectedSalary">
                    <option value="1000-2000">1000-2000</option>
                    <option value="2000-3000">2000-3000</option>
                    <option value="3000-4000">3000-4000</option>
                    <option value="4000-5000">4000-5000</option>
                    <option value="5000-6000">5000-6000</option>
                    <option value="6000-7000">6000-7000</option>
                    <option value="7000-8000">7000-8000</option>
                    <option value="8000-9000">8000-9000</option>
                    <option value="9000+">9000+</option>
                </select>
            </td>
            <td>兴趣爱好：</td>
            <td>
                <input type="text" id="resume_hobbies" name="hobbies" value="${resume.hobbies}" class="resume_input"
                       placeholder="请输入您的兴趣爱好！">
            </td>
        </tr>
        </tbody>
        <tfoot>
        <tr>
            <td colspan="2" id="back">
                <a href="../user/userPageJump" id="resume_back_a">返　回</a>
            </td>
            <td colspan="2" id="save">
                <input type="submit" value="保　存" id="resume_submit">
            </td>
        </tr>
        </tfoot>
    </table>
</form>
<%--</c:if>--%>


<div id="resume_error"></div>

</body>
</html>
